Skip to content

Game Development

What can we say - we like games. And you can use Qt to write some. Questions? Ask here.
868 Topics 4.1k Posts
  • Welcome!

    Pinned
    42
    1 Votes
    42 Posts
    36k Views
    JKSHJ
    Hi, [quote author="cseder" date="1423513071"]But Qt has an excellent solution which makes working with OpenGL a lot simpler: The QGLWidget class is a widget for rendering OpenGL graphics. Read all about it: "QGLWidget docs":http://doc.qt.io/qt-5/qglwidget.html#details.[/quote]QGLWidget is deprecated. Use "QOpenGLWidget":http://doc.qt.io/qt-5/qopenglwidget.html instead. Also check out "VoltAir":http://blog.qt.io/blog/2014/07/21/google-labs-voltair-game-built-with-qt/ -- it is a game that Google built on top of Qt Quick.
  • Tips for Optimizing Qt Performance on Cross-Platform Apps

    Unsolved
    2
    0 Votes
    2 Posts
    125 Views
    ImperoITservicesI
    Hi @meme001 Your proactive steps for UI performance on Android devices should be Utilizing Loader for deferred component initialization Minimizing constantly-updating bindings Optimizing image assets To further enhance UI responsiveness on Android, Consider this Leverage (QtQuick.Controls 2) Optimize Animations Profile with Qt Tools Reduce Overdraw Resource Management Asynchronous Operations Remember, performance optimization is an iterative process. Regular profiling & testing across different devices can provide insights into areas needing improvement.
  • Q: Qt - [c++] Correct CONNECT statements with lambda

    Solved
    11
    0 Votes
    11 Posts
    423 Views
    K
    Well thanks for all your suggestions! Thread solved. best regards
  • LAN Communication for my Multiplayer Board Game on QT/QML

    Unsolved
    2
    0 Votes
    2 Posts
    82 Views
    Pl45m4P
    @SrisharanVS said in LAN Communication for my Multiplayer Board Game on QT/QML: Could anyone guide me on how to handle LAN discovery, establish a connection, and start communicating? If you know of any similar projects, tutorials, or helpful resources, I'd really appreciate it. Start here https://doc.qt.io/qt-6/qtnetwork-programming.html
  • keyPressEvent isn't called simultaneously.

    Unsolved
    3
    0 Votes
    3 Posts
    175 Views
    BondrusiekB
    Hi, try use key handling in this way: https://stackoverflow.com/questions/23816380/using-multiple-keys-in-qt-c I implement this in my simple qt game. Can check: https://github.com/Przemekkkth/top-down-shooter-qt
  • New version of Qt I am trying to write again the code

    Unsolved opengl
    5
    0 Votes
    5 Posts
    432 Views
    ?
    I added -x instead of x and It is working better.
  • Simple Qt/C++ games

    Unsolved
    80
    7 Votes
    80 Posts
    41k Views
    BondrusiekB
    Shake Generator [image: doc.png] Source code: https://github.com/Przemekkkth/shake-generator-qt
  • Trying To Explain To Qt That I Need QGView To Follow My Player Sprite

    Unsolved
    15
    0 Votes
    15 Posts
    632 Views
    G
    @Pl45m4 Thank you for those ideas. I'm feeling less wandering-the-wilderness now, thanks to the advice I'm getting here.
  • Q: Qt - [c++] Qt6 TextToSpeech does not use Localization

    Solved
    9
    0 Votes
    9 Posts
    440 Views
    K
    It appears as if I have mutliple engines installed on my setup. So, instead of auto *text2speech = new QTextToSpeech(this); i changed my code accordingly: for (auto const& v : QTextToSpeech::availableEngines()) { qDebug() << "available engine: " << v.toStdString(); auto *text2Speech = new QTextToSpeech(v); // find suitable locales } So I am not randomizing voices anymore. I take the first best english voice. It works. Now testing on Linux :-) best regards, kevin_d
  • QPainterPath to draw curve with fading

    Unsolved
    5
    0 Votes
    5 Posts
    887 Views
    johngodJ
    @Ejok88 Hi I used the the book of shaders site tutorials to create the fuzzy circle check here https://thebookofshaders.com/ I actually got a very simple idea for your problem, just use a line with width which is just nothing more that a rectangle with two colors on the edjes, and use GL_TRIANGLE_STRIP , see this new example https://bitbucket.org/joaodeusmorgado/opengltutorials/src/master/T11_FuzzyLine/mygl.cpp#lines-185 Then you just add vertices to compose your line, note that you have to use "two" lines side by side to make the double fade out effect. Then you need to add 3 more lines without width, to the center and the 2 lines in the extremes. A bit of work but doable. I can help further if you need, but right now I just to much work overloaded. What is your use case, are you using widgets and Opengl ? I think going with quick3d would be easier, it that is an option for you.
  • No way to use particle system directly from C++?

    Unsolved
    2
    0 Votes
    2 Posts
    247 Views
    BondrusiekB
    Hi, i was also looking for such a module in pure Qt/C++ some time ago. Unfortunately, as far as I know, there is no such equivalent. If you want to achieve such results, you have to use either QPainter or OpenGL.
  • QRhi rendering question

    Unsolved
    2
    0 Votes
    2 Posts
    299 Views
    D
    FWIW, the fixed code (thanks to github copilot) void SpectralChannel::render(QRhiCommandBuffer *cb) { //update resources first updateTextures(); Area scaledDisplayArea=convert.toScaled(displayArea); scaledDisplayArea.moveLeft(0.); QMatrix4x4 scaledDisplayMatrix=scaledDisplayArea.toMatrix(); resourceUpdateBatch()->updateDynamicBuffer(...); for(QHash<LayerPtr, SpectralTextureMeta2>::iterator tex = textureList.begin(); tex != textureList.end(); tex++) { resourceUpdateBatch()->updateDynamicBuffer(...); ... } cb->resourceUpdate(resourceUpdateBatch(true)); //start drawing commands cb->beginPass(renderTarget(), Qt::black, { 1.0f, 0 }, resourceUpdateBatch(true)); cb->setViewport({ 0, 0, float(width()*devicePixelRatio()), float(height()*devicePixelRatio()) }); for(QHash<LayerPtr, SpectralTextureMeta2>::iterator tex = textureList.begin(); tex != textureList.end(); tex++) { cb->setGraphicsPipeline(tex.value().spectralPipeline.get()); const QRhiCommandBuffer::VertexInput vbufBinding(tex.value().vertexBuf.get(), 0); cb->setVertexInput(0, 1, &vbufBinding); cb->setShaderResources(); cb->draw(4); } cb->endPass(updateFrameBuffer()); }
  • Using OpenSSL 3 https connection

    Unsolved
    10
    0 Votes
    10 Posts
    627 Views
    piervalliP
    @JonB in the release notes openssl 3 is added in the 5.15.10
  • 0 Votes
    3 Posts
    467 Views
    D
    Thank you @Christian-Ehrlicher it worked! Could it be considered as a bug? (I would expect the cmake files of Qt to link openGL as I'm using Qt6::OpenGL)
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • Development of a GameController for QtQuick3D

    Unsolved
    1
    1 Votes
    1 Posts
    209 Views
    No one has replied
  • Using Qt to build an editor for an OpenGL ES3 game engine

    Unsolved
    3
    1 Votes
    3 Posts
    555 Views
    S
    For that you'd need DX and OpenGL interop, i.e. you can share a DXGI resource (i.e. a texture) with OpenGL. There are extensions for that. BUT, on Windows Qt uses libAngle which normally uses DX so basically if the right APIs are available you don't need to do any OpenGL - DX interop since everything would be DX at the end of the day.
  • 3 Votes
    41 Posts
    8k Views
    8Observer88
    Critical problems for WebAssembly Background color of parent window is changed to black: https://bugreports.qt.io/browse/QTBUG-120651 emscripten_request_pointerlock() returns EMSCRIPTEN_RESULT_UNKNOWN_TARGET: https://bugreports.qt.io/browse/QTBUG-126513 Dealing with keyboard layout for input on Qt WebAssembly: https://forum.qt.io/post/790688
  • QRHI Compute Shader

    Unsolved
    3
    0 Votes
    3 Posts
    460 Views
    SGaistS
    Hi, I haven't tested QRhi yet but did you try the RHI Window example to see if things are running on all the backends you have on your machine ?
  • QRhi Device Choose

    Unsolved
    7
    0 Votes
    7 Posts
    688 Views
    SGaistS
    Can you post a link to the ticket ? It will make it easier to find for other people looking for a similar functionality.